<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    //为了将普通函数和生成对象的函数区分开 出现了构造函数的概念
    function createMovie(movieName,type,rate,showTime){
        var movieObj={};
        movieObj.movieName=movieName;
        movieObj.type=type;
        movieObj.showTime=showTime;
        movieObj.rate=rate;
        movieObj.getNextShowing=function(){
            var current=11;
            for(var i=0;i<movieObj.showTime.length;i++){
                if(current<parseInt(movieObj.showTime[i]))
                console.log("下一次播放时间"+movie.showTime[i]);
                break;
            }
        }
        return movieObj;
    }
    var movie1=createMovie("007","谍战类","3.0",["12.00","15:00","18:00"]);
    var movie2=createMovie("指环王","，冒险类","4.0",["12.00","15:00","18:00"]);
    console.log(movie1);
    console.log(movie2);
</script>
</html>